class Auth {
  KEY = "token";

  initUser() {
    localStorage.setItem(this.KEY, "");
  }

  getUser() {
    return localStorage.getItem(this.KEY) || "";
  }

  saveUser(token) {
    localStorage.setItem(this.KEY, token);
  }

  removeUser() {
    localStorage.removeItem(this.KEY);
  }
}

// 导出实例化对象
export const auth = new Auth();
